﻿@{
    Layout = null;
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
<title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
     <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

    <script type="text/javascript">
        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnAdd":
                    {
                        ImportDate();
                        break;
                    }

            }
        }
        function ImportDate() {
            if ($("#hidFStatus").val() != "1" & $("#hidFStatus").val() != "7") {
                alert("非申请审核节点不能发送")
            }
            else {
                var checkNo = "";
                //  var PageNoList = "";
                var checkNoList = ASPxClientGridView.Cast("gvEditing").GetSelectedKeysOnPage();
                for (var i = 0; i < checkNoList.length; i++) {
                    checkNo += checkNoList[i] + ",";
                }
                if (checkNoList.length == 0) {
                    alert("请选择条目");
                    return;
                }
                //   alert(checkNo);
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/AllowanceApplicationFormAudit/SaveAll',
                    data: { nolist: checkNo },
                    success: function (result) {
                        // alert("1");
                        if (result == "ok") {
                            // alert(result.split('|')[1]);
                            /// gvEditing.Refresh();
                            alert("发送成功！");
                            window.location.reload();
                        }
                        else {
                            // 
                            //                        var pjson = JSON.parse(result);
                            //                        for (var i = 0; i < pjson.length; i++) {
                            //                            ok(pjson[i].NSRMC, pjson[i].NSRDZDAH, pjson[i].FLocalAmount, pjson[i].FUpLevelAmount, pjson[i].FNote);


                            //                            // return "true";
                            //                        }
                            //                        codeModalMode.Hide();
                            alert("错误信息:" + result);
                        }
                    }
                });
            } 
        }
        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            e.customArgs["pageIndex"] = s.pageIndex;
            e.customArgs["pageCount"] = s.pageCount;
            e.customArgs["pageRowSize"] = s.pageRowSize;
            e.customArgs["pageRowCount"] = s.pageRowCount;
            e.customArgs["FStatus"] = $("#hidFStatus").val();
            e.customArgs["NSRBMQ"] = $("#hidNSRBMQ").val();
        }

        function AllowanceApplicationFormAcceptEdit(codeNo) {
            window.location.href = rootPath + '/AllowanceApplicationFormAudit/AllowanceApplicationFormAuditEdit?FApplicationFormID=' + codeNo;
        }
        function search() {

            $("#hidNSRBMQ").val(NSRBMQ.GetText());
            $("#hidFStatus").val(FStatus.GetValue());
            gvEditing.Refresh();
        }
        function undo() {
            ASPxClientTextBox.Cast("NSRBMQ").SetText("");



            ASPxClientTextBox.Cast("FStatus").SetValue("");


        }
    </script>
</head>
<body>
 @Html.DevExpress().Menu(settings => 
        {
            settings.Name = "toolBarMenu";
            settings.ItemAutoWidth = false;
            settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
            settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
            settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);

            settings.Items.Add(item =>
            {
                item.Name = "btnAdd";
                item.Text = "批量发送";
                item.ClientEnabled = true;
                item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");

            });
             settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
            settings.ItemLinkMode = ItemLinkMode.ContentBounds;
        }).GetHtml()
         <table align="center" class="tableForm">
        <tr>
            <td style="text-align: right; vertical-align: middle" class="tdClass">
                状态:
            </td>
            <td style="text-align: left; vertical-align: middle" class="tdClass">
                @Html.DevExpress().ComboBox(settings =>
      {
          settings.Name = "FStatus";
          settings.Width = 100;
          settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
          settings.Properties.TextField = "Text";
          settings.Properties.ValueField = "Value";
      }).BindList(new List<SelectListItem> { 
                           new SelectListItem { Text = "未受理", Value = "1" },
                         //new SelectListItem { Text = "申请受理", Value = "0" },   
                         new SelectListItem { Text = "被退回", Value = "7" }, 
                          
                              new SelectListItem { Text = "已受理", Value = "2" }
                      
     }).GetHtml()
            </td>
            <td style="text-align: right; vertical-align: middle" class="tdClass">
                纳税人名称
            </td>
            <td class="tdClass">
                @Html.DevExpress().TextBox(settings =>
      {
          settings.Name = "NSRBMQ";
          settings.Width = 200;

      }).GetHtml()
            </td>
            <td align="right" class="tdClass">
            </td>
            <td class="tdClass">
            </td>
            <td>
                @Html.DevExpress().Button(settings =>
            {
                settings.Name = "btnSearch";
                settings.Text = "查询";
                settings.ControlStyle.CssClass = "button";
                settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                settings.ClientSideEvents.Click = "search";
            }).GetHtml()
                @Html.DevExpress().Button(settings =>
            {
                settings.Name = "btnUndo";
                settings.Text = "重置";
                settings.ControlStyle.CssClass = "button";
                settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                settings.ClientSideEvents.Click = "undo";
            }).GetHtml()
            </td>
        </tr>
    </table>
    @Html.Hidden("hidFStatus", ViewData["FStatus"])
    @Html.Hidden("hidNSRBMQ", "")
        @Html.Partial("AllowanceApplicationFormAuditListPartial", Model)
    <script>
        lp.Hide();
    </script>
</body>
</html>
